calculate monthly payment in Python